const validator = require('./validator.min')

/**
 * Component增强
 * @param option
 */
module.exports = function (option) {
    option = option || {}
    option.onInput = function (event) {
        this.setData({
            [event.currentTarget.dataset.dt]: event.detail.value
        })
    }
    option.validator = validator
    return Page(option)
}